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

Side by Side Diff: remoting/host/plugin/host_plugin_utils.cc

Issue 7792011: Run LocalizeStrings() on plugin thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass localize_func as parameter. Created 9 years, 3 months 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
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 #include "remoting/host/plugin/host_plugin_utils.h" 5 #include "remoting/host/plugin/host_plugin_utils.h"
6 6
7 namespace remoting { 7 namespace remoting {
8 8
9 NPNetscapeFuncs* g_npnetscape_funcs = NULL; 9 NPNetscapeFuncs* g_npnetscape_funcs = NULL;
10 10
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 36
37 NPObject* ObjectFromNPVariant(const NPVariant& variant) { 37 NPObject* ObjectFromNPVariant(const NPVariant& variant) {
38 if (!NPVARIANT_IS_OBJECT(variant)) 38 if (!NPVARIANT_IS_OBJECT(variant))
39 return NULL; 39 return NULL;
40 return NPVARIANT_TO_OBJECT(variant); 40 return NPVARIANT_TO_OBJECT(variant);
41 } 41 }
42 42
43 ScopedRefNPObject::ScopedRefNPObject() : object_(NULL) { } 43 ScopedRefNPObject::ScopedRefNPObject() : object_(NULL) { }
44 44
45 ScopedRefNPObject::ScopedRefNPObject(NPObject* object) : object_(object) {
Sergey Ulanov 2011/08/30 00:53:08 nit: move member initialization to the next line.
Lambros 2011/08/30 01:49:26 Done.
46 if (object) {
47 g_npnetscape_funcs->retainobject(object);
48 }
49 }
50
Jamie 2011/08/30 00:43:34 When I write objects where the ctor and operator=
Sergey Ulanov 2011/08/30 00:53:08 I suppose this will not work because of DISALLOW_C
Jamie 2011/08/30 00:57:55 It should work because the parameter is an NPObjec
Lambros 2011/08/30 01:49:26 Done.
45 ScopedRefNPObject::~ScopedRefNPObject() { 51 ScopedRefNPObject::~ScopedRefNPObject() {
46 *this = NULL; 52 *this = NULL;
47 } 53 }
48 54
49 ScopedRefNPObject& ScopedRefNPObject::operator=(NPObject* object) { 55 ScopedRefNPObject& ScopedRefNPObject::operator=(NPObject* object) {
50 if (object) { 56 if (object) {
51 g_npnetscape_funcs->retainobject(object); 57 g_npnetscape_funcs->retainobject(object);
52 } 58 }
53 if (object_) { 59 if (object_) {
54 g_npnetscape_funcs->releaseobject(object_); 60 g_npnetscape_funcs->releaseobject(object_);
55 } 61 }
56 object_ = object; 62 object_ = object;
57 return *this; 63 return *this;
58 } 64 }
59 65
60 } // namespace remoting 66 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698