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

Side by Side Diff: ppapi/cpp/dev/var_array_buffer_dev.cc

Issue 8982006: Add GetLiveVars to PPB_Testing_Dev. Fix leaks it uncovered. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged Created 8 years, 12 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
« no previous file with comments | « ppapi/c/dev/ppb_testing_dev.h ('k') | ppapi/cpp/var.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 #include "ppapi/cpp/dev/var_array_buffer_dev.h" 5 #include "ppapi/cpp/dev/var_array_buffer_dev.h"
6 6
7 #include "ppapi/c/dev/ppb_var_array_buffer_dev.h" 7 #include "ppapi/c/dev/ppb_var_array_buffer_dev.h"
8 #include "ppapi/cpp/logging.h" 8 #include "ppapi/cpp/logging.h"
9 #include "ppapi/cpp/module_impl.h" 9 #include "ppapi/cpp/module_impl.h"
10 10
(...skipping 14 matching lines...) Expand all
25 } else { 25 } else {
26 PP_NOTREACHED(); 26 PP_NOTREACHED();
27 var_ = PP_MakeNull(); 27 var_ = PP_MakeNull();
28 } 28 }
29 } 29 }
30 30
31 VarArrayBuffer_Dev::VarArrayBuffer_Dev(uint32_t size_in_bytes) 31 VarArrayBuffer_Dev::VarArrayBuffer_Dev(uint32_t size_in_bytes)
32 : buffer_(NULL) { 32 : buffer_(NULL) {
33 if (has_interface<PPB_VarArrayBuffer_Dev>()) { 33 if (has_interface<PPB_VarArrayBuffer_Dev>()) {
34 var_ = get_interface<PPB_VarArrayBuffer_Dev>()->Create(size_in_bytes); 34 var_ = get_interface<PPB_VarArrayBuffer_Dev>()->Create(size_in_bytes);
35 needs_release_ = true;
35 buffer_ = Map(); 36 buffer_ = Map();
36 } else { 37 } else {
37 PP_NOTREACHED(); 38 PP_NOTREACHED();
38 var_ = PP_MakeNull(); 39 var_ = PP_MakeNull();
39 } 40 }
40 } 41 }
41 42
42 uint32_t VarArrayBuffer_Dev::ByteLength() const { 43 uint32_t VarArrayBuffer_Dev::ByteLength() const {
43 if (has_interface<PPB_VarArrayBuffer_Dev>()) { 44 if (has_interface<PPB_VarArrayBuffer_Dev>()) {
44 return get_interface<PPB_VarArrayBuffer_Dev>()->ByteLength(var_); 45 return get_interface<PPB_VarArrayBuffer_Dev>()->ByteLength(var_);
(...skipping 12 matching lines...) Expand all
57 return buffer_; 58 return buffer_;
58 if (has_interface<PPB_VarArrayBuffer_Dev>()) { 59 if (has_interface<PPB_VarArrayBuffer_Dev>()) {
59 buffer_ = get_interface<PPB_VarArrayBuffer_Dev>()->Map(var_); 60 buffer_ = get_interface<PPB_VarArrayBuffer_Dev>()->Map(var_);
60 return buffer_; 61 return buffer_;
61 } 62 }
62 PP_NOTREACHED(); 63 PP_NOTREACHED();
63 return 0; 64 return 0;
64 } 65 }
65 66
66 } // namespace pp 67 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/c/dev/ppb_testing_dev.h ('k') | ppapi/cpp/var.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698