Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: content/browser/renderer_host/java/java_bridge_dispatcher_host.h

Issue 8929005: Fix a bug where the JavaBridgeDispatcherHost is prematurely deleted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comment Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/java/java_bridge_dispatcher_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 21 matching lines...) Expand all
32 // object is next cleared, this proxy object is bound to the window object 32 // object is next cleared, this proxy object is bound to the window object
33 // using |name|. The proxy object remains bound until the next time the 33 // using |name|. The proxy object remains bound until the next time the
34 // window object is cleared after a call to RemoveNamedObject() or 34 // window object is cleared after a call to RemoveNamedObject() or
35 // AddNamedObject() with the same name. The proxy object proxies calls back 35 // AddNamedObject() with the same name. The proxy object proxies calls back
36 // to |object|, which is manipulated on the background thread. This class 36 // to |object|, which is manipulated on the background thread. This class
37 // holds a reference to |object| for the time that the proxy object is bound 37 // holds a reference to |object| for the time that the proxy object is bound
38 // to the window object. 38 // to the window object.
39 void AddNamedObject(const string16& name, NPObject* object); 39 void AddNamedObject(const string16& name, NPObject* object);
40 void RemoveNamedObject(const string16& name); 40 void RemoveNamedObject(const string16& name);
41 41
42 // RenderViewHostObserver override: 42 // RenderViewHostObserver overrides:
43 // The IPC macros require this to be public. 43 // The IPC macros require this to be public.
44 virtual bool Send(IPC::Message* msg) OVERRIDE; 44 virtual bool Send(IPC::Message* msg) OVERRIDE;
45 virtual void RenderViewHostDestroyed() OVERRIDE;
45 46
46 private: 47 private:
47 friend class base::RefCountedThreadSafe<JavaBridgeDispatcherHost>; 48 friend class base::RefCountedThreadSafe<JavaBridgeDispatcherHost>;
48 ~JavaBridgeDispatcherHost(); 49 ~JavaBridgeDispatcherHost();
49 50
50 // RenderViewHostObserver override: 51 // RenderViewHostObserver override:
51 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 52 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
52 53
53 // Message handlers 54 // Message handlers
54 void OnGetChannelHandle(IPC::Message* reply_msg); 55 void OnGetChannelHandle(IPC::Message* reply_msg);
55 56
56 void GetChannelHandle(IPC::Message* reply_msg); 57 void GetChannelHandle(IPC::Message* reply_msg);
57 void CreateNPVariantParam(NPObject* object, NPVariant_Param* param); 58 void CreateNPVariantParam(NPObject* object, NPVariant_Param* param);
58 void CreateObjectStub(NPObject* object, int route_id); 59 void CreateObjectStub(NPObject* object, int route_id);
59 60
60 scoped_refptr<NPChannelBase> channel_; 61 scoped_refptr<NPChannelBase> channel_;
61 bool is_renderer_initialized_; 62 bool is_renderer_initialized_;
62 63
63 DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHost); 64 DISALLOW_COPY_AND_ASSIGN(JavaBridgeDispatcherHost);
64 }; 65 };
65 66
66 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_ 67 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_DISPATCHER_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/java/java_bridge_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698