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

Side by Side Diff: webkit/glue/plugins/pepper_resource.cc

Issue 5828003: Move the Pepper implementation from webkit/glue/plugins/pepper_* to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | « webkit/glue/plugins/pepper_resource.h ('k') | webkit/glue/plugins/pepper_resource_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "webkit/glue/plugins/pepper_resource.h"
6
7 #include "base/logging.h"
8 #include "webkit/glue/plugins/pepper_resource_tracker.h"
9
10 namespace pepper {
11
12 Resource::Resource(PluginModule* module)
13 : resource_id_(0), module_(module) {
14 }
15
16 Resource::~Resource() {
17 }
18
19 PP_Resource Resource::GetReference() {
20 ResourceTracker *tracker = ResourceTracker::Get();
21 if (resource_id_)
22 tracker->AddRefResource(resource_id_);
23 else
24 resource_id_ = tracker->AddResource(this);
25 return resource_id_;
26 }
27
28 PP_Resource Resource::GetReferenceNoAddRef() const {
29 return resource_id_;
30 }
31
32 void Resource::StoppedTracking() {
33 DCHECK(resource_id_ != 0);
34 resource_id_ = 0;
35 }
36
37 #define DEFINE_TYPE_GETTER(RESOURCE) \
38 RESOURCE* Resource::As##RESOURCE() { return NULL; }
39 FOR_ALL_RESOURCES(DEFINE_TYPE_GETTER)
40 #undef DEFINE_TYPE_GETTER
41
42 } // namespace pepper
OLDNEW
« no previous file with comments | « webkit/glue/plugins/pepper_resource.h ('k') | webkit/glue/plugins/pepper_resource_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698