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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLUniformLocation.cpp

Issue 2862963003: Replace ASSERT with DCHECK in modules/ (Closed)
Patch Set: NOTREACHED instead of DCHECK(false) Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 18 matching lines...) Expand all
29 namespace blink { 29 namespace blink {
30 30
31 WebGLUniformLocation* WebGLUniformLocation::Create(WebGLProgram* program, 31 WebGLUniformLocation* WebGLUniformLocation::Create(WebGLProgram* program,
32 GLint location) { 32 GLint location) {
33 return new WebGLUniformLocation(program, location); 33 return new WebGLUniformLocation(program, location);
34 } 34 }
35 35
36 WebGLUniformLocation::WebGLUniformLocation(WebGLProgram* program, 36 WebGLUniformLocation::WebGLUniformLocation(WebGLProgram* program,
37 GLint location) 37 GLint location)
38 : program_(program), location_(location) { 38 : program_(program), location_(location) {
39 ASSERT(program_); 39 DCHECK(program_);
40 link_count_ = program_->LinkCount(); 40 link_count_ = program_->LinkCount();
41 } 41 }
42 42
43 WebGLProgram* WebGLUniformLocation::Program() const { 43 WebGLProgram* WebGLUniformLocation::Program() const {
44 // If the program has been linked again, then this UniformLocation is no 44 // If the program has been linked again, then this UniformLocation is no
45 // longer valid. 45 // longer valid.
46 if (program_->LinkCount() != link_count_) 46 if (program_->LinkCount() != link_count_)
47 return 0; 47 return 0;
48 return program_; 48 return program_;
49 } 49 }
50 50
51 GLint WebGLUniformLocation::Location() const { 51 GLint WebGLUniformLocation::Location() const {
52 // If the program has been linked again, then this UniformLocation is no 52 // If the program has been linked again, then this UniformLocation is no
53 // longer valid. 53 // longer valid.
54 ASSERT(program_->LinkCount() == link_count_); 54 ASSERT(program_->LinkCount() == link_count_);
55 return location_; 55 return location_;
56 } 56 }
57 57
58 DEFINE_TRACE(WebGLUniformLocation) { 58 DEFINE_TRACE(WebGLUniformLocation) {
59 visitor->Trace(program_); 59 visitor->Trace(program_);
60 } 60 }
61 61
62 } // namespace blink 62 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698