Fix API changes

This commit is contained in:
Cheng Zhao 2015-04-21 18:56:08 +08:00
parent 32f0ae5b50
commit b37c73436b
13 changed files with 33 additions and 37 deletions

View file

@ -50,9 +50,8 @@ class WebViewManager : public content::BrowserPluginGuestManager {
protected:
// content::BrowserPluginGuestManager:
content::WebContents* GetGuestByInstanceID(
content::WebContents* embedder_web_contents,
int element_instance_id) override;
content::WebContents* GetGuestByInstanceID(int owner_process_id,
int element_instance_id) override;
bool ForEachGuest(content::WebContents* embedder,
const GuestCallback& callback) override;
@ -65,26 +64,25 @@ class WebViewManager : public content::BrowserPluginGuestManager {
std::map<int, WebContentsWithEmbedder> web_contents_embdder_map_;
struct ElementInstanceKey {
content::WebContents* owner_web_contents;
int embedder_process_id;
int element_instance_id;
ElementInstanceKey(content::WebContents* owner_web_contents,
int element_instance_id)
: owner_web_contents(owner_web_contents),
ElementInstanceKey(int embedder_process_id, int element_instance_id)
: embedder_process_id(embedder_process_id),
element_instance_id(element_instance_id) {}
bool operator<(const ElementInstanceKey& other) const {
if (owner_web_contents != other.owner_web_contents)
return owner_web_contents < other.owner_web_contents;
if (embedder_process_id != other.embedder_process_id)
return embedder_process_id < other.embedder_process_id;
return element_instance_id < other.element_instance_id;
}
bool operator==(const ElementInstanceKey& other) const {
return (owner_web_contents == other.owner_web_contents) &&
return (embedder_process_id == other.embedder_process_id) &&
(element_instance_id == other.element_instance_id);
}
};
// (web_contents, element_instance_id) => guest_instance_id
// (embedder_process_id, element_instance_id) => guest_instance_id
std::map<ElementInstanceKey, int> element_instance_id_to_guest_map_;
typedef std::map<int, WebViewInfo> WebViewInfoMap;