2012년 3월 22일 목요일

Content Shell 의 구조 - ShellMainDelegate 클래스(2)

이전 포스트에서는 ContentMainDelegate 인터페이스 클래스에 대해 알아보았다.
이제 ShellMainDelegate 클래스에 대해 살펴볼 시간이다.

ShellMainDelegate 클래스는 생성자, 소멸자, ContentMainDelegate 인터페이스 클래스의
멤버함수들, 그리고 두개의 private 멤버함수, 다섯개의 private 멤버함수로 구성되어 있다.

private 멤버함수는 다음과 같다.

InitializeShellContentClient()
InitializeResourceBundle()

private 멤버 변수는 다음과 같다.

content::ShellContentBrowserClient          browser_client_
content::ShellContentRendererClient         renderer_client_
content::ShellContentPluginClient             plugin_client_
content::ShellContentUtilityClient             utility_client_
content::ShellContentClient                     content_client_

위 변수들의 이름을 보면 ShellContentXXXClient 인 것을 알 수 있다.
여기서 잠깐,,, Client 이긴 한데 무엇의 Client 일까? Client가 있으면 Server도 있어야 하는데
여기서 Server는 무엇일까?

잠시 Content Module로 돌아가서 여기에서 말하는 Client - Server 가 무엇인지 알아보자.

Content Shell에 대한 포스트 에서 Content Shell은 Content Module을 이용한 레퍼런스
브라우저라고 잠깐 이야기를 했었다.

Chrome 이나 Content Shell 은 각각의 ContentMainDelegate 인터페이스 클래스를 구현하고
그 객체를 ContentMain() 함수에 매개변수로 전달하는것으로 브라우저가 시작이된다.

이 구조로 본다면, Content Module이 Server 가 되고, Delegate 가 Client 가 되겠다.
Content Shell 이라는 Client 가 Content Module 이라는 Server 를  이용해서 브라우저를 구성하고 있는것이다.

Content Module이 동작을 하면서 자신을 구동시킨 Client (Chrome or Content Shell)를
호출(?)하고 싶을때, 이 Delegate 내 Client 를 이용하여 함수들을 호출을 하는것이다.

Client 들이 무슨 일을 하는지, Content Module에서는 언제 Client 를 호출해서 이용하는지 궁금해진다.
차차 알아보자~^^;

다시 ShellMainDelegate 클래스로 돌아가서,,,

InitializeShellContentClient() 멤버 함수가 있다. 이름으로 미루어 이 함수를 이용해서
위에서 선언된 여러 Client 들을 초기화하지 않을까 싶다.

이것은 다음 포스트에서 실제 ShellMainDelegate 함수들의 구현을 살펴보면서 확인해보자.

댓글 없음:

댓글 쓰기