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

Side by Side Diff: ppapi/shared_impl/var.cc

Issue 7706021: Convert FileRefImpl and URLRequestInfo to shared_impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests fixed 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 "ppapi/shared_impl/var.h" 5 #include "ppapi/shared_impl/var.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return var_id_; 90 return var_id_;
91 } 91 }
92 92
93 void Var::AssignVarID(int32 id) { 93 void Var::AssignVarID(int32 id) {
94 DCHECK(!var_id_); // Must not have already been generated. 94 DCHECK(!var_id_); // Must not have already been generated.
95 var_id_ = id; 95 var_id_ = id;
96 } 96 }
97 97
98 // StringVar ------------------------------------------------------------------- 98 // StringVar -------------------------------------------------------------------
99 99
100 StringVar::StringVar(PP_Module module, const std::string& str)
101 : Var(module),
102 value_(str) {
103 }
104
100 StringVar::StringVar(PP_Module module, const char* str, uint32 len) 105 StringVar::StringVar(PP_Module module, const char* str, uint32 len)
101 : Var(module), 106 : Var(module),
102 value_(str, len) { 107 value_(str, len) {
103 } 108 }
104 109
105 StringVar::~StringVar() { 110 StringVar::~StringVar() {
106 } 111 }
107 112
108 StringVar* StringVar::AsStringVar() { 113 StringVar* StringVar::AsStringVar() {
109 return this; 114 return this;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 return NULL; 149 return NULL;
145 scoped_refptr<Var> var_object( 150 scoped_refptr<Var> var_object(
146 TrackerBase::Get()->GetVarTracker()->GetVar(var)); 151 TrackerBase::Get()->GetVarTracker()->GetVar(var));
147 if (!var_object) 152 if (!var_object)
148 return NULL; 153 return NULL;
149 return var_object->AsStringVar(); 154 return var_object->AsStringVar();
150 } 155 }
151 156
152 } // namespace ppapi 157 } // namespace ppapi
153 158
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698