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

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

Issue 2629543002: pp::Buffer_Dev: Clear PP_Resource upon Map() error in Init() (Closed)
Patch Set: real fix Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | 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/buffer_dev.h" 5 #include "ppapi/cpp/dev/buffer_dev.h"
6 6
7 #include "ppapi/c/dev/ppb_buffer_dev.h" 7 #include "ppapi/c/dev/ppb_buffer_dev.h"
8 #include "ppapi/cpp/instance_handle.h" 8 #include "ppapi/cpp/instance_handle.h"
9 #include "ppapi/cpp/module.h" 9 #include "ppapi/cpp/module.h"
10 #include "ppapi/cpp/module_impl.h" 10 #include "ppapi/cpp/module_impl.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 Init(); 57 Init();
58 return *this; 58 return *this;
59 } 59 }
60 60
61 void Buffer_Dev::Init() { 61 void Buffer_Dev::Init() {
62 if (get_interface<PPB_Buffer_Dev>()->Describe(pp_resource(), &size_)) { 62 if (get_interface<PPB_Buffer_Dev>()->Describe(pp_resource(), &size_)) {
63 data_ = get_interface<PPB_Buffer_Dev>()->Map(pp_resource()); 63 data_ = get_interface<PPB_Buffer_Dev>()->Map(pp_resource());
64 if (data_) 64 if (data_)
65 return; 65 return;
66 } 66 }
67
68 Clear();
67 data_ = NULL; 69 data_ = NULL;
68 size_ = 0; 70 size_ = 0;
69 } 71 }
70 72
71 } // namespace pp 73 } // namespace pp
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698