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

Side by Side Diff: content/renderer/pepper/host_var_tracker_unittest.cc

Issue 63253002: Rename WebKit namespace to blink (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « content/renderer/pepper/host_globals.cc ('k') | content/renderer/pepper/message_channel.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "content/renderer/pepper/host_globals.h" 6 #include "content/renderer/pepper/host_globals.h"
7 #include "content/renderer/pepper/host_var_tracker.h" 7 #include "content/renderer/pepper/host_var_tracker.h"
8 #include "content/renderer/pepper/mock_resource.h" 8 #include "content/renderer/pepper/mock_resource.h"
9 #include "content/renderer/pepper/npapi_glue.h" 9 #include "content/renderer/pepper/npapi_glue.h"
10 #include "content/renderer/pepper/npobject_var.h" 10 #include "content/renderer/pepper/npobject_var.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 object->_class = &g_tracked_npclass; 52 object->_class = &g_tracked_npclass;
53 object->referenceCount = 1; 53 object->referenceCount = 1;
54 54
55 g_npobjects_alive++; 55 g_npobjects_alive++;
56 return object; 56 return object;
57 } 57 }
58 58
59 class ReleaseNPObject { 59 class ReleaseNPObject {
60 public: 60 public:
61 void operator()(NPObject* o) const { 61 void operator()(NPObject* o) const {
62 WebKit::WebBindings::releaseObject(o); 62 blink::WebBindings::releaseObject(o);
63 } 63 }
64 }; 64 };
65 65
66 // Handles automatically releasing a reference to the NPObject on destruction. 66 // Handles automatically releasing a reference to the NPObject on destruction.
67 // It's assumed the input has a ref already taken. 67 // It's assumed the input has a ref already taken.
68 typedef scoped_ptr_malloc<NPObject, ReleaseNPObject> NPObjectReleaser; 68 typedef scoped_ptr_malloc<NPObject, ReleaseNPObject> NPObjectReleaser;
69 69
70 } // namespace 70 } // namespace
71 71
72 class HostVarTrackerTest : public PpapiUnittest { 72 class HostVarTrackerTest : public PpapiUnittest {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 var_tracker->ReleaseVar(static_cast<int32_t>(pp_object1.value.as_id)); 125 var_tracker->ReleaseVar(static_cast<int32_t>(pp_object1.value.as_id));
126 126
127 // Releasing the resource should free the internal ref, and so making a new 127 // Releasing the resource should free the internal ref, and so making a new
128 // one now should generate a new ID. 128 // one now should generate a new ID.
129 PP_Var pp_object3 = NPObjectToPPVarForTest(instance(), npobject.get()); 129 PP_Var pp_object3 = NPObjectToPPVarForTest(instance(), npobject.get());
130 EXPECT_NE(pp_object1.value.as_id, pp_object3.value.as_id); 130 EXPECT_NE(pp_object1.value.as_id, pp_object3.value.as_id);
131 var_tracker->ReleaseVar(static_cast<int32_t>(pp_object3.value.as_id)); 131 var_tracker->ReleaseVar(static_cast<int32_t>(pp_object3.value.as_id));
132 } 132 }
133 133
134 } // namespace content 134 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/host_globals.cc ('k') | content/renderer/pepper/message_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698